<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>报账统计</title>
    <link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
    <script src="../../layui/layui.js"></script>
    <script src="../../layui/layui-xtree.js"></script>
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <script src="../../js/jquery-1.8.3.js"></script>
    <script src="../../js/util.js"></script>
    <script>
        function getdate(number) {
            var myDate = new Date();
            //当前年份
            var nowyear = myDate.getFullYear();
            //当前月份
            var nowmonth = myDate.getMonth() + 1;
            var month=nowmonth-number;
            var year=month>0?nowyear:nowyear-1;
            month=month>0?month:month+12;
            var date=year+"."+month;
            return date;
        }

            layui.use(['layer', 'table', 'jquery', 'element'], function () {
                var table = layui.table;
                var layer = layui.layer;
                var $ = layui.$;
                $("#download").on('click', function () {
                    location.href = '/smsCountMonth/export';
                });
                var index = layer.load(1, {
                    shade: [0.1,'#fff'] //0.1透明度的白色背景
                });


                table.render({
                    elem: "#table",//表格id
                    id: "modelReload", //id
                    url: '/smsCountMonth/find',
                    method: 'post',
                    cellMinWidth:100,
                    request: {
                        pageName: 'page',
                        limitName: 'limit'
                    },
                    response: {
                        statusName: 'code',
                        statusCode: 0,
                        msgName: 'msg',
                        countName: 'count',
                        dataName: 'data'
                    },
                    page: true,
                    count: "count",
                    limit: 10,
                    limits: [10, 20, 30, 40, 50],
                    layout: ['prev', 'page', 'next'],
                    prev: "上一页",
                    next: "下一页",
                    cols: [[
                        {field: 'cityName', title: '地市', rowspan: 2, fixed: 'left'}
                        , {field: 'mgrName', title: '项目名称', rowspan: 2, fixed: 'left'}
                        , {title: getdate(1), colspan: 5,align: 'center'}
                        , {title: getdate(2), colspan: 5,align: 'center'}
                        , {title: getdate(3), colspan: 5,align: 'center'}
                        , {title: getdate(4), colspan: 5,align: 'center'}
                        , {title: getdate(5), colspan: 5,align: 'center'}
                        , {title: getdate(6), colspan: 5,align: 'center'}
                        , {title: getdate(7), colspan: 5,align: 'center'}
                        , {title: getdate(8), colspan: 5,align: 'center'}
                        , {title: getdate(9), colspan: 5,align: 'center'}
                        , {title: getdate(10), colspan: 5,align: 'center'}
                        , {title: getdate(11), colspan: 5,align: 'center'}
                        , {title: getdate(12), colspan: 5,align: 'center'}], [
                        {field: 'long1', title: '长短信'}
                        , {field: 'normal1', title: '正常短信'}
                        ,{field:'longSplit1',title:'长短信拆分'}
                        ,{field:'longCount1',title:'长短信汇总'}
                        ,{field:'normalCount1',title:'正常信汇总'}
                        , {field: 'long2', title: '长短信'}
                        , {field: 'normal2', title: '正常短信'}
                        ,{field:'longSplit2',title:'长短信拆分'}
                        ,{field:'longCount2',title:'长短信汇总'}
                        ,{field:'normalCount2',title:'正常信汇总'}
                        , {field: 'long3', title: '长短信'}
                        , {field: 'normal3', title: '正常短信'}
                        ,{field:'longSplit3',title:'长短信拆分'}
                        ,{field:'longCount3',title:'长短信汇总'}
                        ,{field:'normalCount3',title:'正常信汇总'}
                        , {field: 'long4', title: '长短信'}
                        , {field: 'normal4', title: '正常短信'}
                        ,{field:'longSplit4',title:'长短信拆分'}
                        ,{field:'longCount4',title:'长短信汇总'}
                        ,{field:'normalCount4',title:'正常信汇总'}
                        , {field: 'long5', title: '长短信'}
                        , {field: 'normal5', title: '正常短信'}
                        ,{field:'longSplit5',title:'长短信拆分'}
                        ,{field:'longCount5',title:'长短信汇总'}
                        ,{field:'normalCount5',title:'正常信汇总'}
                        , {field: 'long6', title: '长短信'}
                        , {field: 'normal6', title: '正常短信'}
                        ,{field:'longSplit6',title:'长短信拆分'}
                        ,{field:'longCount6',title:'长短信汇总'}
                        ,{field:'normalCount6',title:'正常信汇总'}
                        , {field: 'long7', title: '长短信'}
                        , {field: 'normal7', title: '正常短信'}
                        ,{field:'longSplit7',title:'长短信拆分'}
                        ,{field:'longCount7',title:'长短信汇总'}
                        ,{field:'normalCount7',title:'正常信汇总'}
                        , {field: 'long8', title: '长短信'}
                        , {field: 'normal8', title: '正常短信'}
                        ,{field:'longSplit8',title:'长短信拆分'}
                        ,{field:'longCount8',title:'长短信汇总'}
                        ,{field:'normalCount8',title:'正常信汇总'}
                        , {field: 'long9', title: '长短信'}
                        , {field: 'normal9', title: '正常短信'}
                        ,{field:'longSplit9',title:'长短信拆分'}
                        ,{field:'longCount9',title:'长短信汇总'}
                        ,{field:'normalCount9',title:'正常信汇总'}
                        , {field: 'long10', title: '长短信'}
                        , {field: 'normal10', title: '正常短信'}
                        ,{field:'longSplit10',title:'长短信拆分'}
                        ,{field:'longCount10',title:'长短信汇总'}
                        ,{field:'normalCount10',title:'正常信汇总'}
                        , {field: 'long11', title: '长短信'}
                        , {field: 'normal11', title: '正常短信'}
                        ,{field:'longSplit11',title:'长短信拆分'}
                        ,{field:'longCount11',title:'长短信汇总'}
                        ,{field:'normalCount11',title:'正常信汇总'}
                        , {field: 'long12', title: '长短信'}
                        , {field: 'normal12', title: '正常短信'}
                        ,{field:'longSplit12',title:'长短信拆分'}
                        ,{field:'longCount12',title:'长短信汇总'}
                        ,{field:'normalCount12',title:'正常信汇总'}

                    ]],   done: function (res) {
                       // console.log(JSON.stringify(res));
                        layer.close(index);
                   }
                });
            });

    </script>
</head>
<body>
<div class="layui-content-body">
    <div class="scroll-box">
        <div class="breadcrumb-box">
              <span class="layui-breadcrumb" lay-separator="|">
 <a href="javascript:returnIndex2()">首页&nbsp;</a>
  <a href="">&nbsp;报表管理&nbsp;</a>
  <a href="">&nbsp;报账统计&nbsp;</a>
</span>
        </div>
        <div class="content-box ">
            <button class="layui-btn layui-btn-normal" type="button" id="download">
                导出
            </button>
            <div class="table-box" >
                <table class="layui-table" id="table">
                </table>
            </div>
        </div>
    </div>
</div>
</body>
</html>